<?php
require_once(CHEMIN_MODELE.'Telephone.php');
/**
 * Description of TelephoneManager
 *
 * @author Yahn_V
 */
class TelephoneManager {
    public static function getLesTelephone($loginUser) {
        try {
            $pdo = PDO2::getInstance();
            $requete = $pdo->prepare("SELECT * FROM Tel WHERE login = :login");
            $requete->bindValue(':login',$loginUser);
            $requete->execute();
            $tableauTel = array();
            while ($donnees = $requete->fetch(PDO::FETCH_OBJ)) {
                $tel = new Telephone($donnees->tel, $donnees->type);
                $tableauTel[] = $tel;
            }
        } catch (PDOException $e) {
            echo $e->getMessage();
        }

        return $tableauTel;
    }
}

?>
